<?php
/**
 *
 * @author griever
 * @version
 */
require_once 'Zend/Loader/PluginLoader.php';
require_once 'Zend/Controller/Action/Helper/Abstract.php';
require_once 'models/User.php';
require_once 'Base.php';

/**
 * CheckEmail Action Helper
 *
 * @uses actionHelper Custom_Helper
 */
class Custom_Helper_CheckEmailWellForm extends Dummy_Helper_Base
{

	public function checkEmail($email)	{
		$emailValidator = new Zend_Validate_EmailAddress();
		$result = $emailValidator->isValid($email);
		$error = null;
		if ($result === false)
		{
			$error = Message::EMAIL_NOT_WELLFORM;
		}
		return $error;
	}

	/**
	 * Strategy pattern: call helper as broker method
	 */
	public function direct($email){
		// TODO Auto-generated 'direct' method
		return $this->checkEmail($email);
	}
}

